{#**
*
* 功能描述（列表模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}
{#include file="header.tpl" title="title" active="cake" #}
{#include file="define.tpl" scope=parent#}
<div class="content middle">
    <div class="ui breadcrumb">
        <a class="section" href="index.php">主页</a>
        <i class="right"></i>
        <span class="active section">产品管理</span>
    </div>
    <div style="overflow: hidden;">
        {#$cake_title = [
            'no' => '编号',
            'updatetime' => '更新时间',
            'createtime' => '创建时间',
            'name' => '名称',
            'introduce' => '介绍',
            'fav_times' => '收藏次数',
            'sales' => '销量'
        ]#}
        {#include file="search_bar.tpl" s_basic=['cheap'=>[0,'优惠', [1=>'全价',2=>'打折',3=>'免费']],'type2'=>[0,'特性',$cake_type2_2], 'type'=>[0,'所属类别',$cake_type]] s_keys=$cake_title s_checkbox=['visible'=>[1,'WEB可见']]#}
    </div>
    <div class="button_bar">
        <a class="button align_right" href="index.php?action=cake.toadd">添加产品</a>
    </div>
    <table class="ui table segment">
        <thead>
            <tr>
                <th>产品编号</th>
                <th>产品名称</th>
                <th>所属类别</th>
                <th>特性</th>
                <th>销量</th>
                <th>收藏次数</th>
                <th>添加日期</th>
                <th>最近修改日期</th>
                <th>折扣</th>
                <th>WEB可见</th>
                <th>价格</th>
                <th>评价</th>
                <th>编辑</th>
            </tr>
        </thead>
        <tbody>
            {#foreach $listdata as $item#}
                <tr>
                    <td><a href="index.php?action=cake.detail&id={#$item['id']#}">{#$item['no']#}</a></td>
                    <td><span>{#$item['name']#}</span>{#if isset($item['type2']) and ($item['type2'] == '1')#}&nbsp;<img src="images/new.png">{#/if#}</td>
                    <td>{#$cake_type[$item['type']]#}</td>
                    <td>{#$cake_type2[$item['type2']]#}</td>
                    <td>{#$item['sales']#}</td>
                    <td>{#$item['fav_times']#}</td>
                    <td>{#$item['createtime']|date_format:"%Y-%m-%d"#}</td>
                    <td>{#$item['updatetime']|date_format:"%Y-%m-%d"#}</td>
                    <td><input style="width: 3em;" type="text" value="{#$item['discount']*10#}" onchange="ajax_value(this, 'index.php?action=cake.setdis&id={#$item['id']#}&dis=')"/></td>
                    <td>
                        <select onchange="ajax_value(this, 'index.php?action=cake.setvisible&id={#$item['id']#}&visible=')">
                            {#foreach $yesno as $k => $v#}
                                <option value="{#$k#}"{#if $item['visible'] == $k#}selected=true{#/if#}>{#$v#}</option>
                            {#/foreach#}
                        </select>
                    </td>
                    <td><a href="index.php?action=cake.prices&id={#$item['id']#}">价格</a></td>
                    <td><a href="index.php?action=comment.showlist&key=goods_id&keyword={#$item['id']#}">评价</a></td>
                    <td><a href="index.php?action=cake.tomod&id={#$item['id']#}">编辑</a></td>
                </tr>
            {#/foreach#}
        </tbody>
        <tfoot>
            <tr>
                <th colspan="14" style="font-style: normal;">
                    {#include file="paging_bar.tpl"#}
                </th>
            </tr>
        </tfoot>
    </table>
</div>
{#include file="footer.tpl" #}
